﻿
Public Module _CDO
    Public Function saveWebToMHT(ByVal address As String, ByVal outputFile As String) As Boolean
        On Error Resume Next
        Dim msg As New CDO.Message
        checkHttpAddress(address)
        raiseError("save webpage to mht from url = " + address)
        msg.Configuration = New CDO.Configuration
        msg.CreateMHTMLBody(address, CDO.CdoMHTMLFlags.cdoSuppressAll, _
                            defaultValue.emptyString, defaultValue.emptyString)
        msg.GetStream.SaveToFile(outputFile, ADODB.SaveOptionsEnum.adSaveCreateOverWrite)

        Return Not msg.GetStream Is Nothing
    End Function
End Module
